<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test</title>
</head>
<body>
<h2>aaaaaaaaaaaaa</h2>

<button id="btn">AJAX</button>

<script src="jquery-3.5.1.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#btn").click(function () {
            $.post("/postCookie", function (data) {
                alert(data);
            });
        });
    });

</script>

</body>
</html>